package com.example.food_contract_system.controller;

import com.example.food_contract_system.service.FoodRecommedService;
import com.example.food_contract_system.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LiHaoyang
 * @date 2023/7/14  14:34
 **/
@RestController
@RequestMapping("/foodRecommend")
public class FoodRecommendController {
    @Autowired
    private FoodRecommedService foodRecommedService;

    @GetMapping("/insertRecommend/{fId}/{frecommendStatus}")
    public R insertRecommend(@PathVariable("fId") String fId,
                             @PathVariable("frecommendStatus") String status){
        R result = foodRecommedService.insertRecommend(fId,status);

        return result;
    }

    @GetMapping("/getRecommend")
    public R getRecommend(){
        return foodRecommedService.getRecommend();
    }
}
